package com.allwees.bs.c.module.user.controller;

import com.allwees.bs.c.module.base.controller.BaseController;
import com.allwees.bs.c.module.user.service.IFeedbackService;
import com.allwees.bs.c.module.user.vo.FeedbackVo;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.core.common.util.http.RequestContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收集反馈
 */
@RestController
public class FeedbackController extends BaseController {

    @Autowired
    private IFeedbackService feedbackService;

    /**
     * 收集反馈
     * @param feedbackVo
     * @return
     */
    @PostMapping("/api/v1/feedback")
    public R feedback(@RequestBody @Validated FeedbackVo feedbackVo) {
        this.feedbackService.feedback(getUserUuid(), feedbackVo, RequestContext.getChannel());
        return R.ok();
    }
}
